import React, { useEffect } from 'react'
import { useLocation } from 'react-router-dom'
import Navbar from '../components/Navbar';
import { Tabs } from 'antd-mobile'
import { orderlist } from '../apis/order';

export default function OrderSee() {
  const location = useLocation()
  useEffect(() => {
    order_list()
  }, [])
  let order_list = async () => {
    let res = await orderlist(localStorage.getItem("userid"))
    console.log(res);

  }
  return (
    <div>
      <Navbar title="查看订单"/>

      <Tabs defaultActiveKey={location.state.key}>
        <Tabs.Tab title='全部订单' key='allorder'>
          菠萝
        </Tabs.Tab>
        <Tabs.Tab title='待付款' key='pay'>
          西红柿
        </Tabs.Tab>
        <Tabs.Tab title='待收货' key='takeover'>
          蚂蚁
        </Tabs.Tab>
        <Tabs.Tab title='待评价' key='appraise'>
          蚂蚁
        </Tabs.Tab>
      </Tabs>
    </div>
  )
}
